/*
 * UMLSynch plugin for Eclipse
 * http://umlsynch.googlecode.com
 *
 * Copyright 2008-2010, Evgeny Alexeyev
 * Licensed under the EPL - v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */

package com.googlecode.umlsynch.eclipse.parser;

import java.util.ArrayList;
import java.util.List;


public class InputParser {
	String input;
	String output;
	int argNum;

	String projectName;
	String className;
	
	List listOfParser;
	public static InputParser singletone;

	InputParser() 
	{
		listOfParser = new ArrayList();
	}
	
	public static InputParser instance()
	{
		if (singletone == null)
		{
			singletone = new InputParser();						
		}
		return singletone;
	}
	
	void addInputParser(InputParser newParser)
	{
		if (listOfParser == null)
			return;
		listOfParser.add(newParser);
	}
	
	public String Parse(String cmd)
	{
		String result = null;
		if ((listOfParser == null) || (listOfParser.isEmpty()))
			return null;

		for (int i = 0; i < listOfParser.size(); i++)
		{
			result = ((InputParser)listOfParser.get(i)).Parse(cmd);
			if (result != null)
				return result;
		}
		return result;
	}
	
	public String Process() { return null;};	
}
